package calao.contact;

import calao.Application;
import calao.Service;
import calao.contact.client.ContactService;
import calao.storage.Schema;

public class ContactApplication
extends Application
{

	static final public String NAME = "calao.contact";
	
	public static final Schema SCHEMA;
	
	static {
		Schema schema = new Schema();
		schema.add(ContactDB.TABLE);
		schema.add(ContactDB.ID_SEQUENCE);
		schema.add(GroupDB.TABLE);
		schema.add(GroupDB.ID_SEQUENCE);
		schema.add(new PostAddressBinding());
		schema.register();
		SCHEMA = schema;
	}
	
	public ContactApplication()
	{
		super(NAME);
	}
	
	@Override
	public Service newService(Class serviceFace)
	{
		return serviceFace==ContactService.class? new ContactServiceImpl() : null;
	}
	
}
